﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Browser;

namespace SilverlightBase.Classes
{
	public class Search
	{
		public class Events
		{
			public static void SearchBtn_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
			{
				DoLiveSearch();
			}

			public static void SearchTxt_KeyDown(object sender, KeyEventArgs e)
			{
				if (e.Key == Key.Enter)
					DoLiveSearch();
			}

			private static void DoLiveSearch()
			{
				HtmlPage.Window.Navigate(new Uri("http://search.live.com/results.aspx?q=" + ((Page)Application.Current.RootVisual).searchTxt.Text.Replace(" ", "+") + "&form=QBLH"), "_blank");
			}
		}
	}
}
